kill (bash built-in)
kill (bash built-in)
code:plain
Send the processes identified by PID or JOBSPEC the signal named by
SIGSPEC or SIGNUM. If neither SIGSPEC nor SIGNUM is present, then
SIGTERM is assumed.
デフォルトではSIGTERM
現在のシェルでkill 0を実行したら終了してしまいそうだけど、そうではない
対話シェル && trapが無ければSIGTERMは無視する
When Bash is interactive, in the absence of any traps, it ignores SIGTERM (so that ‘kill 0’ does not kill an interactive shell), and SIGINT is caught and handled (so that the wait builtin is interruptible).
kill -KILL 0したら終了した
Bashのジョブをkill -STOP と kill -CONT で一時停止・再開することもできる